﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLNHang.GUI
{
    public partial class frmMain : Form
    {
        private UserControl uc;
        public frmMain()
        {
            InitializeComponent();
        }

        private void btnLapPhieuNhapKho_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucLapPhieuNhapKho();
            pnMain.Controls.Add(uc);
        }

        private void btnLapPhieuThuMua_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucLapPhieuThuMua();
            pnMain.Controls.Add(uc);
        }

        private void btnCapNhatNguyenVatLieu_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucCapNhatNguyenVatLieu();
            pnMain.Controls.Add(uc);
        }

        private void btnLapPhieuYeuCauXuatKinhPhi_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucLapPhieuYeuCauXuatKinhPhi();
           
            pnMain.Controls.Add(uc);
            uc.Dock = DockStyle.Fill;
        }

        private void btnLapThucDon_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucLapThucDon();
            pnMain.Controls.Add(uc);
        }

        private void btnLapPhieuXuatNguyenVatLieu_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucLapPhieuYeuCauXuatNguyenVatLieu();
            pnMain.Controls.Add(uc);
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            //frmLogin frm = new frmLogin();
            //frm.ShowDialog();
            //int phanQuyen = frm.PhanQuyen;
            //PhanQuyen(phanQuyen);
        }

        private void PhanQuyen(int phanQuyen) 
        {
            switch (phanQuyen)
            {
                case 1:
                case 2:
                default:
                    break;
            }
        
        }

        private void btnXemDanhSachNguyenVatLieuTon_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucXemDanhSachNguyenVatLieuTon();
            pnMain.Controls.Add(uc);
        }

        private void btnThemVe_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucThemVe();
            pnMain.Controls.Add(uc);
        }

        private void btnThemKhachHang_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucThemKhachHang();
            pnMain.Controls.Add(uc);
        }

        private void btnThemHoaDon_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Remove(uc);
            uc = new ucThemHoaDon();
            pnMain.Controls.Add(uc);

        }

       
    }
}
